{% include top.html %}
{% capture homepage %}http://people.apache.org/~{{ page.author }}{% endcapture %}

<body class="wrap">
  <header>
    {% include header.html %}
  </header>

  <div class="container p-lg-4">
    <main role="main">

    <h1>
      {{ page.title }}
      <a href="{{ page.url }}" class="permalink" title="Permalink">∞</a>
    </h1>

    {% capture discard %}
      {% for c in site.data.contributors %}
        {% if c.apacheId == page.author %}
          {% assign author_name = c.name %}
          {% if c.homepage %}
            {% assign homepage = c.homepage %}
          {% else %}
            {% capture homepage %}http://github.com/{{ c.githubId }}{% endcapture %}
          {% endif %}
          {% if c.avatar %}
            {% assign avatar = c.avatar %}
          {% else %}
            {% capture avatar %}http://github.com/{{ c.githubId }}.png{% endcapture %}
          {% endif %}
        {% endif %}
      {% endfor %}
    {% endcapture %}{% assign discard = nil %}

    <p>
      <span class="badge badge-secondary">Published</span>
      <span class="published">
        {{ page.date | date_to_string }}
      </span>
      <br />
      <span class="badge badge-secondary">By</span>
      <a href="{{ homepage }}">{{ author_name }} ({{ post.author }})</a>
    </p>

    {{ content }}
    </main>

    {% include footer.html %}
  </div>
</body>
</html>
